@extends('Home.Index.index')
@section('title')
    登录
@endsection
@section('tag')

@show
@section('content')
<section id="main" class="entire_width">
    <div class="container_12">
        <div id="content">
            <div class="grid_12">
                <h1 class="page_title">登录或者创建一个帐户</h1>
            </div><!-- .grid_12 -->

            <div class="grid_6 new_customers">
                <h2>新用户</h2>
                <p>通过在我们的商店创建一个帐户，您将能够更快地浏览结帐过程，存储多个送货地址，查看和跟踪您的订单在您的帐户和更多。</p>
                <div class="clear"></div>
                <button class="account" id="register">创建一个新用户</button>

            </div><!-- .grid_6 -->

            <div class="grid_6">
                <form class="registed">
                    <h2>用户登录</h2>

                    <div class="email">
                        <strong>账号：</strong><sup class="surely">*</sup><br/>
                        <input type="text" name="" class="" value="" id="username" style="width: 260px"/>
                    </div><!-- .email -->

                    <div class="password">
                        <strong>密码：</strong><sup class="surely">*</sup><br/>
                        <input type="password" name="" class="" value="" id="passwd" style="width: 260px"/>
                        <a class="forgot" href="#">忘记密码</a>
                    </div><!-- .password -->

                    <div class="remember">

                        <input type="checkbox" name="Remember_password" id="undefined" value="on" tabindex="0">

                        <span class="rem" >记住密码</span>
                    </div><!-- .remember -->

                    <div class="submit">
                        <button type="button" style="width: 280px" id="login_in">&nbsp;&nbsp; &nbsp; 登录 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</button>
                    </div><!-- .submit -->
                </form><!-- .registed -->
            </div><!-- .grid_6 -->
        </div><!-- #content -->

        <div class="clear"></div>
    </div><!-- .container_12 -->
</section><!-- #main -->

<div class="clear"></div>

<script>
    $(function () {
        $('#login_in').click(function (e) {
            var username = $('#username').val();
            var passwd   = $('#passwd').val();

            $.post('',{username:username,passwd:passwd},function (e) {
                console.log(e);
                if(e.status)
                {
                    window.location.href="/";

                }else {
                    layer.msg(e.info,{icon:5});
                }
            })
        });
    })
</script>
<script>
    $(function() {
        $('#list_product').carouFredSel({
            prev: '#prev_c1',
            next: '#next_c1',
            auto: false
        });
        $('#list_product2').carouFredSel({
            prev: '#prev_c2',
            next: '#next_c2',
            auto: false
        });
        $('#list_banners').carouFredSel({
            prev: '#ban_prev',
            next: '#ban_next',
            scroll: 1,
            auto: false
        });
        $(window).resize();
    });
</script>
<script>
    $(document).ready(function(){
        $("button").click(function(){
            $(this).addClass('click')
        });
    })
</script>
@endsection

